<template>
    <view class="content">
        <u-tabbar :list="routes" @change="handleChange"></u-tabbar>
    </view>
</template>
<script>
    export default {
        name: 'Statistics',
        data() {
            return {
                routes: [],
                current: 1,
            }
        },
        watch: {
            '$store.state.router.current': {
                handler(nval) {
                    this.current = nval
                },
            },
        },
        mounted() {
            this.routes = this.$store.state.router.routes
        },
        methods: {
            handleChange(val) {
                this.$store.commit({ type: 'setCurrent', val })
            },
        },
    }
</script>
<style lang="sass"></style>
